using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using SouthernLand.Common.BOL.Articles;

namespace SouthernLand.WebMaster.Articles
{
    public partial class Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void btDelete_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in GridViewItem.Rows)
            {
                bool isChecked = ((CheckBox) row.FindControl("chkSelect")).Checked;
                if (isChecked)
                {
                    int ArticleID = Convert.ToInt32(((CheckBox) row.FindControl("chkSelect")).ToolTip.Trim());
                    Article.Delete(ArticleID);
                }
            }
            DataBind();
        }

        protected void btSearch_Click(object sender, EventArgs e)
        {
            GridViewItem.DataSourceID = "SearchDataSource";
        }
    }
}